Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add runtime properties to Quarkus builder #43160

Merged
merged 1 commit into from
Sep 10, 2024
Merged

Conversation

radcortez
Copy link
Member

@radcortez radcortez commented Sep 9, 2024

This allows integrators to set runtime properties to be recorded in the Quarkus build.

@quarkus-bot quarkus-bot bot added area/config area/core area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/jbang Issues related to when using jbang.dev with Quarkus labels Sep 9, 2024
@radcortez radcortez requested a review from gsmet September 9, 2024 18:28
@@ -54,7 +56,7 @@ public static Map<String, Object> postBuild(Path appClasses, Path pomFile, List<
if (equals == -1) {
throw new RuntimeException("invalid config " + comment);
}
System.setProperty(conf.substring(0, equals), conf.substring(equals + 1));
runtimeProperties.setProperty(conf.substring(0, equals), conf.substring(equals + 1));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the real solution?

jbang just always passed Q:CONFIG values in which could both be a mix of build and runtime properties....should we just pass same set of properties as runtime and build properties then ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is the clean way to do it. It didn't work for before because we do not record properties coming from the system. We did this for the quarkus namespace, but we also removed that with #39604, which explains why it worked in previous versions but not in all cases.

Since system are not recorded, and that is how properties were propagated in the JBang integrations, it caused the issue. To fix it, we needed a way to propagate the properties. I thought about generating a source or a file, but ultimately, I think the API in the builder will work better because we have this needed elsewhere; see #27996.

These runtimeProperties are also part of the build config (the same as application.properties). It just tells us that they can be recorded. Regardless, I can also pass these to the build properties to make it more explicit.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. Sounds good and seems @gsmet tested so should be good.

I'll run it through jbang tests when have cr release and should spot if at least keep past fixes :)

@quarkus-bot
Copy link

quarkus-bot bot commented Sep 10, 2024

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit be4817d.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

@gsmet
Copy link
Member

gsmet commented Sep 10, 2024

I tested it and it looks good for runtime properties.

As for build time properties, I tested with quarkus.log.min-level and it worked fine too (i.e. the build time property is taken into account).

@gsmet gsmet merged commit 089dafb into quarkusio:main Sep 10, 2024
52 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.16 - main milestone Sep 10, 2024
@gsmet gsmet modified the milestones: 3.16 - main, 3.14.3 Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config area/core area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/jbang Issues related to when using jbang.dev with Quarkus kind/bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jbang does not persist Q:CONFIG keys nor build set keys
3 participants